<!--
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-04-12 18:48:37
 * @LastEditTime: 2022-07-09 14:48:13
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description: 详情查看 页面
 * @FilePath: \vue3-element-plus-web\src\views\DrawerDemo\components\Drawer\detail.vue
 * Copyright 版权声明
-->
<template>
  <div class="">
    <el-form
      ref="dataForm"
      :model="temp"
      label-width="80px"
      style='width:100%;'
    >
        <el-form-item label="主键：">
          {{temp.id}}
        </el-form-item>
        <el-form-item label="父主键：">
          {{temp.parentId}}
        </el-form-item>
        <el-form-item label="字典码：">
          {{temp.code}}
        </el-form-item>
        <el-form-item label="字典值：">
          {{temp.dictKey}}
        </el-form-item>
        <el-form-item label="字典名称：">
          {{temp.dictValue}}
        </el-form-item>
        <el-form-item label="排序：">
          {{temp.sort}}
        </el-form-item>
        <el-form-item label="字典备注：">
          {{temp.remark}}
        </el-form-item>
        <el-form-item label="是否已封存：">
          {{temp.isSealed}}
        </el-form-item>
        <el-form-item label="：">
          {{temp.createTime}}
        </el-form-item>
        <el-form-item label="：">
          {{temp.updateTime}}
        </el-form-item>
        <el-form-item label="状态：" prop="status">
          <el-radio-group v-model="temp.status">
            <el-radio
              v-for="item in statusList"
              :key="item.value"
              :label="item.value">
              {{item.label}}
            </el-radio>
          </el-radio-group>
        </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Detail',
  computed: {
    ...mapGetters([
      'drawerCurrent'
    ]),
    drawerType: function() {
      return this.drawerCurrent.drawerType
    }
  },
  components: {
  },
  data() {
    return {
      temp: {}
    }
  },
  watch: {
  },
  created() {
    // 列表传过来的数据
    const temp = this.drawerCurrent.params.row
    this.temp = Object.assign({}, this.temp, temp)
    // *************如果需要从接口数据的话执行一下操作
    // drawer loadding 状态 打开
    this.$store.dispatch('SetDrawerloading', true)
    setTimeout(() => {
      // drawer loadding 状态 关闭
      this.$store.dispatch('SetDrawerloading', false)
    }, 500)
  },
  activated() {
  },
  deactivated() {
  },
  methods: {
    // 获取表单数据
    getFormData() {
      return this.temp
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
</style>
